#' Online rolling central moments
#'
#' @param period rolling window period
#' @param type type of rolling window
#'
#' @return a stateful function
#' @export
#'
new_rollmoment <- function(period, type = c("ro", "cu"))
{
  type <- match.arg(type)
  switch(type,
         ro = mk_online_func_x("rollmoment", period),
         cu = mk_online_func_x("rollmoment_cu"))
}
